﻿using System;
using System.ComponentModel;
using Xyz.BusinessObjects.Validation;

namespace Xyz.BusinessObjects
{
    public class MemberPayment : BusinessObject
	{
        public MemberPayment()
        {
            AddRule(new ValidateMandatory("BookingId"));
            AddRule(new ValidateMandatory("MemberId"));
            AddRule(new ValidateMandatory("PaymentPoints"));
            AddRule(new ValidateMandatory("PaymentDate"));
        }

        public int BookingId { get; set; }
        public int MemberId { get; set; }
        public decimal PaymentPoints { get; set; }
        public DateTime PaymentDate { get; set; }

        public void ComputePaymentPoints()
        {
            PaymentPoints = Math.Round(PaymentPoints * 1.5m);
        }
	}
}


